<?php defined('BASEPATH') OR exit('No direct script access allowed');?>

<!-- +++++ Blog List +++++ -->

<div class="pink">
    <div class="container">
        <div class="row">

            <!-- 静态导航 -->
            <div class="col-lg-8 col-lg-offset-2">
                <ul class="nav nav-tabs">

                    <li>
                        <a href="/blog/tid" class="nav-header">BLogList</a>
                    </li>

                    <?php foreach ($typelist as $v): ?>
                    <li <?php if($tid == $v['id']){echo 'class="active"';} ?> >
                        <a href="/blog/tid/<?=$v['id']?>"><?=$v['name']?></a>
                    </li>
                    <?php endforeach; ?>

                </ul>
                <br><br>
            </div>

            <!-- +++++ 单页最多显示6篇博客 +++++ -->

            <?php foreach ($bloglist as $v): ?>
            <div class="col-lg-8 col-lg-offset-2">
                <div class="my-well">

                    <!-- +++++ 博客 +++++ -->
                    <div class="avatar">
                        <img src="/assets/public/img/user.jpg">
                    </div>
                    <div class="blog-info">
                        <div class="blog-info-at">
                            <a href="/blog/id/<?=$v['id']?>">Li Lijie - <b><?=$v['title']?></b></a>
                        </div>
                        <div class="blog-info-date"><?=$v['date']?></div>
                    </div>
                    <div class="blog-content">简介 ： <?=$v['intro']?></div>

                </div>
            </div>
            <?php endforeach; ?>

            <!-- +++++ 分页页码 +++++ -->
            <div class="col-lg-8 col-lg-offset-2">
                <ul class="pagination">

                    <?php if($page > 1): ?>
                    <li>
                        <a id="my-a" href="/blog/tid/<?=$tid.'?page='.($page-1)?>">
                            <span class="fa fa-chevron-left"></span>
                        </a>
                    </li>
                    <?php endif; ?>

                    <?php for ($i = 1 ;$i <= $all;$i++): ?>
                    <li>
                        <?php if ($i==$page): ?>
                            <a style="color: grey"> <?=$i?> </a>
                        <?php else: ?>
                            <a id="my-a" href="/blog/tid/<?=$tid.'?page='.$i?>"><?=$i?></a>
                        <?php endif; ?>
                    </li>
                    <?php endfor; ?>

                    <?php if($page < $all): ?>
                    <li>
                        <a id="my-a" href="/blog/tid/<?=$tid.'?page='.($page+1)?>">
                            <span class="fa fa-chevron-right"></span>
                        </a>
                    </li>
                    <?php endif; ?>

                </ul>
            </div>

        </div><!-- /row -->
    </div> <!-- /container -->
</div><!-- /white -->